package net.disy.cadenza.repository.selector;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class ObjectTypeCondition {
	private String objectTypeName;
	private Set<String> attributeNames;
	private Map<String, List<String>> attributeValuesMap;
	
	public ObjectTypeCondition(String objectTypeName){
		this.objectTypeName = objectTypeName;
		this.attributeNames = new HashSet<String>();
		this.attributeValuesMap = new HashMap<String, List<String>>();
	}
	
	public void addAttribute(String attributeName){
		attributeNames.add(attributeName);
	}
	public void addAttributeValues(String attributeName, Set<String> values){
		List<String> attributeValues = attributeValuesMap.get(attributeName);
		if(attributeValues == null){
			attributeValues = new ArrayList<String>();
			attributeValuesMap.put(attributeName, attributeValues);
		}
		attributeValues.addAll(values);
	}

	public String getObjectTypeName() {
		return objectTypeName;
	}

	public Set<String> getAttributeNames() {
		return attributeNames;
	}

	public Map<String, List<String>> getAttributeValuesMap() {
		return attributeValuesMap;
	}

}
